/**
 * 3号烧杯
 */
Beaker3 = Widget.extend({
	ctor:function(){
		this._super();
		this.initBeaker();
		this.setTag(TAG_BUNSEN3);
	},
	initBeaker:function(){			
		this.body = new Button(this, 10, TAG_BEAKER3, "#beaker/beaker.png", this.callback);
		this.body.setScale(1.3);

		var line = new cc.Sprite("#beaker_line.png");
		line.setOpacity(0);
		line.setPosition(31,7);
		line.setScale(1, 0.5);
		this.body.addChild(line, 5, TAG_BEAKER3_LINE);

		var nameLabel = new cc.LabelTTF("③", gg.fontName, 20);
		nameLabel.setColor(cc.color(0,0,0));
		nameLabel.setPosition(this.body.width * 0.5, 60);
		this.body.addChild(nameLabel);

		var hand = new Button(this, 9, TAG_RIGHT, "#hand_right.png", this.callback);
		hand.setPosition(cc.p(30,-45));
//		hand.setScale(0.7);
		hand.setVisible(false);
		var part = new Button(this, 11, TAG_RIGHT_PART, "#hand_part.png", this.callback);
		part.setPosition(cc.p(30,-45));
//		part.setScale(0.7);
		part.setVisible(false);

		this.callNext = cc.callFunc(function(){
			gg.flow.next();
		}, this);
		this.callNext.retain();
	},
	callback:function(p){
		var action=gg.flow.flow.action;
		var hand=this.getChildByTag(TAG_RIGHT);
		var part=this.getChildByTag(TAG_RIGHT_PART);
		switch(p.getTag()){
		case TAG_BEAKER3:			
			hand.setVisible(true);
			part.setVisible(true);
			var move=cc.moveTo(0.6, cc.p(640,310));
			var seq=cc.sequence(move,cc.callFunc(function() {
				var show=new ShowTip("滤液为饱和食盐水，" +
						"可循环利用，重新倒回反应容器中\n" +
						"侯德榜制碱法，生产原料的循环利用，既节省设备，又提高生产效率",
						cc.p(700,180));
				hand.setVisible(false);
				part.setVisible(false);
			}, this),cc.delayTime(8),this.callNext);
			this.runAction(seq);
			break;
		}
	},
	actionDone:function(p){
		switch(p.getTag()){
		case TAG_BEAKER1:	
			gg.flow.next();
			break;
		}
	},
	onExit:function(){
		this._super();
		this.callNext.release();
	}
});